import { reactive } from 'vue'
import { VxeColumnProps } from "vxe-table";
export default function handleColumn (column:any){
  let columns = reactive<VxeColumnProps | any>(column)



  const setCoulums = (disCoulum:any) => {
    columns.map((item:any) => {
      let visble = disCoulum.includes(item.field)
      if(visble){
        if(item.field){
          item.visible = false
        }
      } else {
        if(item.field){
          item.visible = true
        }
      }
      return item
    })
  }
  return {
    columns,
    setCoulums
  }
}